﻿using EasyCore.Auth;
using Microsoft.Extensions.Configuration;
using Microsoft.Identity.Client;
using NPOI.OpenXmlFormats.Dml;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace EasyCore.Extensions
{
    /// <summary>
    /// 配置数据的扩展类
    /// </summary>
    public static class ConfigurationExtensions
    {
        public static T Get<T>(this IConfiguration configuration, string key)
        {
            var model = configuration.GetSection(key).Get<T>();
            return model == null ? default(T) : model;
        }
    }
}
